package com.wyw.mahjong.server.handler;

import com.wyw.mahjong.common.protocol.MahjongProtocol;
import com.wyw.mahjong.server.executor.MahjongEventExecutorGroup;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import lombok.extern.slf4j.Slf4j;

/**
 * @Title
 * @Description
 * @Author Mr Wu yewen.wu.china@gmail.com
 * @Date 2024/5/6 18:15
 * Update History:
 * Author        Time            Content
 */
@Slf4j
public class MahjongServerHandler extends SimpleChannelInboundHandler<MahjongProtocol> {

    @Override
    protected void channelRead0(ChannelHandlerContext ctx, MahjongProtocol mahjongProtocol) throws Exception {
        log.info("receive msg: {}", mahjongProtocol);
        MahjongEventExecutorGroup.execute(ctx.channel(), mahjongProtocol);
    }
}
